<template>
	<view>
		<web-view ref="myWebview" id="myWebview" :src="src" @message="messaged"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 1,
				src: null,
				DataDs: null,
			};
		},
		onLoad(item) {
			if (item.id) {
				this.id = item.id
			}
			this.src = `https://yunlzz.com.cn/wxh5/recordDs?id=${this.id}&&token=${this.$store.state.token}`
		},
		methods: {
			messaged(e) {
				console.log(e)
				let par = e.target.data[0]
				if (par.action == 'getData') {
					this.DataDs = par.data
				}
			},
			onUnload() {
				uni.$emit('dataDsEvent', this.DataDs); // 触发自定义事件，并传递参数
			},
		},
	}
</script>

<style lang="less">

</style>